private {
	import derelict.opengl.gltypes;
	import std.c.windows.windows;
}


// WGL_ARB_buffer_region
const GLenum WGL_FRONT_COLOR_BUFFER_BIT_ARB = 0x00000001;
const GLenum WGL_BACK_COLOR_BUFFER_BIT_ARB = 0x00000002;
const GLenum WGL_DEPTH_BUFFER_BIT_ARB = 0x00000004;
const GLenum WGL_STENCIL_BUFFER_BIT_ARB = 0x00000008;
//

// WGL_ARB_pixel_format
const GLenum WGL_NUMBER_PIXEL_FORMATS_ARB = 0x2000;
const GLenum WGL_DRAW_TO_WINDOW_ARB = 0x2001;
const GLenum WGL_DRAW_TO_BITMAP_ARB = 0x2002;
const GLenum WGL_ACCELERATION_ARB = 0x2003;
const GLenum WGL_NEED_PALETTE_ARB = 0x2004;
const GLenum WGL_NEED_SYSTEM_PALETTE_ARB = 0x2005;
const GLenum WGL_SWAP_LAYER_BUFFERS_ARB = 0x2006;
const GLenum WGL_SWAP_METHOD_ARB = 0x2007;
const GLenum WGL_NUMBER_OVERLAYS_ARB = 0x2008;
const GLenum WGL_NUMBER_UNDERLAYS_ARB = 0x2009;
const GLenum WGL_TRANSPARENT_ARB = 0x200A;
const GLenum WGL_TRANSPARENT_RED_VALUE_ARB = 0x2037;
const GLenum WGL_TRANSPARENT_GREEN_VALUE_ARB = 0x2038;
const GLenum WGL_TRANSPARENT_BLUE_VALUE_ARB = 0x2039;
const GLenum WGL_TRANSPARENT_ALPHA_VALUE_ARB = 0x203A;
const GLenum WGL_TRANSPARENT_INDEX_VALUE_ARB = 0x203B;
const GLenum WGL_SHARE_DEPTH_ARB = 0x200C;
const GLenum WGL_SHARE_STENCIL_ARB = 0x200D;
const GLenum WGL_SHARE_ACCUM_ARB = 0x200E;
const GLenum WGL_SUPPORT_GDI_ARB = 0x200F;
const GLenum WGL_SUPPORT_OPENGL_ARB = 0x2010;
const GLenum WGL_DOUBLE_BUFFER_ARB = 0x2011;
const GLenum WGL_STEREO_ARB = 0x2012;
const GLenum WGL_PIXEL_TYPE_ARB = 0x2013;
const GLenum WGL_COLOR_BITS_ARB = 0x2014;
const GLenum WGL_RED_BITS_ARB = 0x2015;
const GLenum WGL_RED_SHIFT_ARB = 0x2016;
const GLenum WGL_GREEN_BITS_ARB = 0x2017;
const GLenum WGL_GREEN_SHIFT_ARB = 0x2018;
const GLenum WGL_BLUE_BITS_ARB = 0x2019;
const GLenum WGL_BLUE_SHIFT_ARB = 0x201A;
const GLenum WGL_ALPHA_BITS_ARB = 0x201B;
const GLenum WGL_ALPHA_SHIFT_ARB = 0x201C;
const GLenum WGL_ACCUM_BITS_ARB = 0x201D;
const GLenum WGL_ACCUM_RED_BITS_ARB = 0x201E;
const GLenum WGL_ACCUM_GREEN_BITS_ARB = 0x201F;
const GLenum WGL_ACCUM_BLUE_BITS_ARB = 0x2020;
const GLenum WGL_ACCUM_ALPHA_BITS_ARB = 0x2021;
const GLenum WGL_DEPTH_BITS_ARB = 0x2022;
const GLenum WGL_STENCIL_BITS_ARB = 0x2023;
const GLenum WGL_AUX_BUFFERS_ARB = 0x2024;
const GLenum WGL_NO_ACCELERATION_ARB = 0x2025;
const GLenum WGL_GENERIC_ACCELERATION_ARB = 0x2026;
const GLenum WGL_FULL_ACCELERATION_ARB = 0x2027;
const GLenum WGL_SWAP_EXCHANGE_ARB = 0x2028;
const GLenum WGL_SWAP_COPY_ARB = 0x2029;
const GLenum WGL_SWAP_UNDEFINED_ARB = 0x202A;
const GLenum WGL_TYPE_RGBA_ARB = 0x202B;
const GLenum WGL_TYPE_COLORINDEX_ARB = 0x202C;
//

// WGL_ARB_make_current_read
const GLenum ERROR_INVALID_PIXEL_TYPE_ARB = 0x2043;
const GLenum ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = 0x2054;
//

// WGL_ARB_pbuffer
const GLenum WGL_DRAW_TO_PBUFFER_ARB = 0x202D;
const GLenum WGL_MAX_PBUFFER_PIXELS_ARB = 0x202E;
const GLenum WGL_MAX_PBUFFER_WIDTH_ARB = 0x202F;
const GLenum WGL_MAX_PBUFFER_HEIGHT_ARB = 0x2030;
const GLenum WGL_PBUFFER_LARGEST_ARB = 0x2033;
const GLenum WGL_PBUFFER_WIDTH_ARB = 0x2034;
const GLenum WGL_PBUFFER_HEIGHT_ARB = 0x2035;
const GLenum WGL_PBUFFER_LOST_ARB = 0x2036;
//

// WGL_ATI_pixel_format_float
const GLenum WGL_RGBA_FLOAT_MODE_ATI = 0x8820;
const GLenum WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835;
const GLenum WGL_TYPE_RGBA_FLOAT_ATI = 0x21A0;
//

// WGL_EXT_make_current_read
const GLenum ERROR_INVALID_PIXEL_TYPE_EXT = 0x2043;
//

// WGL_EXT_pixel_format
const GLenum WGL_NUMBER_PIXEL_FORMATS_EXT = 0x2000;
const GLenum WGL_DRAW_TO_WINDOW_EXT = 0x2001;
const GLenum WGL_DRAW_TO_BITMAP_EXT = 0x2002;
const GLenum WGL_ACCELERATION_EXT = 0x2003;
const GLenum WGL_NEED_PALETTE_EXT = 0x2004;
const GLenum WGL_NEED_SYSTEM_PALETTE_EXT = 0x2005;
const GLenum WGL_SWAP_LAYER_BUFFERS_EXT = 0x2006;
const GLenum WGL_SWAP_METHOD_EXT = 0x2007;
const GLenum WGL_NUMBER_OVERLAYS_EXT = 0x2008;
const GLenum WGL_NUMBER_UNDERLAYS_EXT = 0x2009;
const GLenum WGL_TRANSPARENT_EXT = 0x200A;
const GLenum WGL_TRANSPARENT_VALUE_EXT = 0x200B;
const GLenum WGL_SHARE_DEPTH_EXT = 0x200C;
const GLenum WGL_SHARE_STENCIL_EXT = 0x200D;
const GLenum WGL_SHARE_ACCUM_EXT = 0x200E;
const GLenum WGL_SUPPORT_GDI_EXT = 0x200F;
const GLenum WGL_SUPPORT_OPENGL_EXT = 0x2010;
const GLenum WGL_DOUBLE_BUFFER_EXT = 0x2011;
const GLenum WGL_STEREO_EXT = 0x2012;
const GLenum WGL_PIXEL_TYPE_EXT = 0x2013;
const GLenum WGL_COLOR_BITS_EXT = 0x2014;
const GLenum WGL_RED_BITS_EXT = 0x2015;
const GLenum WGL_RED_SHIFT_EXT = 0x2016;
const GLenum WGL_GREEN_BITS_EXT = 0x2017;
const GLenum WGL_GREEN_SHIFT_EXT = 0x2018;
const GLenum WGL_BLUE_BITS_EXT = 0x2019;
const GLenum WGL_BLUE_SHIFT_EXT = 0x201A;
const GLenum WGL_ALPHA_BITS_EXT = 0x201B;
const GLenum WGL_ALPHA_SHIFT_EXT = 0x201C;
const GLenum WGL_ACCUM_BITS_EXT = 0x201D;
const GLenum WGL_ACCUM_RED_BITS_EXT = 0x201E;
const GLenum WGL_ACCUM_GREEN_BITS_EXT = 0x201F;
const GLenum WGL_ACCUM_BLUE_BITS_EXT = 0x2020;
const GLenum WGL_ACCUM_ALPHA_BITS_EXT = 0x2021;
const GLenum WGL_DEPTH_BITS_EXT = 0x2022;
const GLenum WGL_STENCIL_BITS_EXT = 0x2023;
const GLenum WGL_AUX_BUFFERS_EXT = 0x2024;
const GLenum WGL_NO_ACCELERATION_EXT = 0x2025;
const GLenum WGL_GENERIC_ACCELERATION_EXT = 0x2026;
const GLenum WGL_FULL_ACCELERATION_EXT = 0x2027;
const GLenum WGL_SWAP_EXCHANGE_EXT = 0x2028;
const GLenum WGL_SWAP_COPY_EXT = 0x2029;
const GLenum WGL_SWAP_UNDEFINED_EXT = 0x202A;
const GLenum WGL_TYPE_RGBA_EXT = 0x202B;
const GLenum WGL_TYPE_COLORINDEX_EXT = 0x202C;
//

// WGL_EXT_pbuffer
const GLenum WGL_DRAW_TO_PBUFFER_EXT = 0x202D;
const GLenum WGL_MAX_PBUFFER_PIXELS_EXT = 0x202E;
const GLenum WGL_MAX_PBUFFER_WIDTH_EXT = 0x202F;
const GLenum WGL_MAX_PBUFFER_HEIGHT_EXT = 0x2030;
const GLenum WGL_OPTIMAL_PBUFFER_WIDTH_EXT = 0x2031;
const GLenum WGL_OPTIMAL_PBUFFER_HEIGHT_EXT = 0x2032;
const GLenum WGL_PBUFFER_LARGEST_EXT = 0x2033;
const GLenum WGL_PBUFFER_WIDTH_EXT = 0x2034;
const GLenum WGL_PBUFFER_HEIGHT_EXT = 0x2035;
//

// WGL_ARB_render_texture
const GLenum WGL_BIND_TO_TEXTURE_RGB_ARB = 0x2070;
const GLenum WGL_BIND_TO_TEXTURE_RGBA_ARB = 0x2071;
const GLenum WGL_TEXTURE_FORMAT_ARB = 0x2072;
const GLenum WGL_TEXTURE_TARGET_ARB = 0x2073;
const GLenum WGL_MIPMAP_TEXTURE_ARB = 0x2074;
const GLenum WGL_TEXTURE_RGB_ARB = 0x2075;
const GLenum WGL_TEXTURE_RGBA_ARB = 0x2076;
const GLenum WGL_NO_TEXTURE_ARB = 0x2077;
const GLenum WGL_TEXTURE_CUBE_MAP_ARB = 0x2078;
const GLenum WGL_TEXTURE_1D_ARB = 0x2079;
const GLenum WGL_TEXTURE_2D_ARB = 0x207A;
const GLenum WGL_MIPMAP_LEVEL_ARB = 0x207B;
const GLenum WGL_CUBE_MAP_FACE_ARB = 0x207C;
const GLenum WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D;
const GLenum WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E;
const GLenum WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F;
const GLenum WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080;
const GLenum WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081;
const GLenum WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082;
const GLenum WGL_FRONT_LEFT_ARB = 0x2083;
const GLenum WGL_FRONT_RIGHT_ARB = 0x2084;
const GLenum WGL_BACK_LEFT_ARB = 0x2085;
const GLenum WGL_BACK_RIGHT_ARB = 0x2086;
const GLenum WGL_AUX0_ARB = 0x2087;
const GLenum WGL_AUX1_ARB = 0x2088;
const GLenum WGL_AUX2_ARB = 0x2089;
const GLenum WGL_AUX3_ARB = 0x208A;
const GLenum WGL_AUX4_ARB = 0x208B;
const GLenum WGL_AUX5_ARB = 0x208C;
const GLenum WGL_AUX6_ARB = 0x208D;
const GLenum WGL_AUX7_ARB = 0x208E;
const GLenum WGL_AUX8_ARB = 0x208F;
const GLenum WGL_AUX9_ARB = 0x2090;
//

// WGL_EXT_depth_float
const GLenum WGL_DEPTH_FLOAT_EXT = 0x2040;
//

// WGL_NV_float_buffer
const GLenum WGL_FLOAT_COMPONENTS_NV = 0x20B0;
const GLenum WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = 0x20B1;
const GLenum WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = 0x20B2;
const GLenum WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = 0x20B3;
const GLenum WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = 0x20B4;

const GLenum WGL_TEXTURE_FLOAT_R_NV = 0x20B5;
const GLenum WGL_TEXTURE_FLOAT_RG_NV = 0x20B6;
const GLenum WGL_TEXTURE_FLOAT_RGB_NV = 0x20B7;
const GLenum WGL_TEXTURE_FLOAT_RGBA_NV = 0x20B8;
//

// WGL_NV_render_texture_rectangle
const GLenum WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = 0x20A0;
const GLenum WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = 0x20A1;

const GLenum WGL_TEXTURE_RECTANGLE_NV = 0x20A2;
//


// WGL_NV_render_depth_texture
const GLenum WGL_TEXTURE_DEPTH_COMPONENT_NV = 0x20A6;
const GLenum WGL_DEPTH_TEXTURE_FORMAT_NV = 0x20A5;
const GLenum WGL_BIND_TO_TEXTURE_DEPTH_NV = 0x20A3;
const GLenum WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = 0x20A4;
const GLenum WGL_DEPTH_COMPONENT_NV = 0x20A7;
//

// WGL_3DFX_multisample
const GLenum WGL_SAMPLE_BUFFERS_3DFX = 0x2060;
const GLenum WGL_SAMPLES_3DFX = 0x2061;
//

// WGL_EXT_multisample
const GLenum WGL_SAMPLE_BUFFERS_EXT = 0x2041;
const GLenum WGL_SAMPLES_EXT = 0x2042;
//

// WGL_I3D_unknown_genlock_extension_name
const GLenum WGL_GENLOCK_SOURCE_MULTIVIEW_I3D = 0x2044;
const GLenum WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D = 0x2045;
const GLenum WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D = 0x2046;
const GLenum WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D = 0x2047;
const GLenum WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D = 0x2048;
const GLenum WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D = 0x2049;
const GLenum WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D = 0x204A;
const GLenum WGL_GENLOCK_SOURCE_EDGE_RISING_I3D = 0x204B;
const GLenum WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D = 0x204C;
//

// WGL_I3D_unknown_gamma_extension_name
const GLenum WGL_GAMMA_TABLE_SIZE_I3D = 0x204E;
const GLenum WGL_GAMMA_EXCLUDE_DESKTOP_I3D = 0x204F;
//

// WGL_I3D_unknown_digital_video_cursor_extension_name
const GLenum WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D = 0x2050;
const GLenum WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D = 0x2051;
const GLenum WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = 0x2052;
const GLenum WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D = 0x2053;
//


/*************************************************************/


// WGL_ARB_pbuffer
typedef void* HPBUFFERARB;
//

// WGL_EXT_pbuffer
typedef void* HPBUFFEREXT;
//


/*************************************************************/

extern(Windows):

/*************************************************************/


// WGL_ARB_buffer_region
typedef HANDLE  function(HDC, int, UINT) pfwglCreateBufferRegionARB;
pfwglCreateBufferRegionARB wglCreateBufferRegionARB;

typedef VOID  function(HANDLE) pfwglDeleteBufferRegionARB;
pfwglDeleteBufferRegionARB wglDeleteBufferRegionARB;

typedef BOOL  function(HANDLE, int, int, int, int) pfwglSaveBufferRegionARB;
pfwglSaveBufferRegionARB wglSaveBufferRegionARB;

typedef BOOL  function(HANDLE, int, int, int, int, int, int) pfwglRestoreBufferRegionARB;
pfwglRestoreBufferRegionARB wglRestoreBufferRegionARB;
//

// WGL_ARB_extensions_string


typedef char *  function(HDC) pfwglGetExtensionsStringARB;
pfwglGetExtensionsStringARB wglGetExtensionsStringARB;
//

// WGL_ARB_pixel_format


typedef BOOL  function(HDC, int, int, UINT, int *, int *) pfwglGetPixelFormatAttribivARB;
pfwglGetPixelFormatAttribivARB wglGetPixelFormatAttribivARB;

typedef BOOL  function(HDC, int, int, UINT, int *, FLOAT *) pfwglGetPixelFormatAttribfvARB;
pfwglGetPixelFormatAttribfvARB wglGetPixelFormatAttribfvARB;

typedef BOOL  function(HDC, int *, FLOAT *, UINT, int *, UINT *) pfwglChoosePixelFormatARB;
pfwglChoosePixelFormatARB wglChoosePixelFormatARB;
//

// WGL_ARB_make_current_read


typedef BOOL  function(HDC, HDC, HGLRC) pfwglMakeContextCurrentARB;
pfwglMakeContextCurrentARB wglMakeContextCurrentARB;

typedef HDC  function() pfwglGetCurrentReadDCARB;
pfwglGetCurrentReadDCARB wglGetCurrentReadDCARB;
//

// WGL_ARB_pbuffer
typedef HPBUFFERARB  function(HDC, int, int, int, int *) pfwglCreatePbufferARB;
pfwglCreatePbufferARB wglCreatePbufferARB;

typedef HDC  function(HPBUFFERARB) pfwglGetPbufferDCARB;
pfwglGetPbufferDCARB wglGetPbufferDCARB;

typedef int  function(HPBUFFERARB, HDC) pfwglReleasePbufferDCARB;
pfwglReleasePbufferDCARB wglReleasePbufferDCARB;

typedef BOOL  function(HPBUFFERARB) pfwglDestroyPbufferARB;
pfwglDestroyPbufferARB wglDestroyPbufferARB;

typedef BOOL  function(HPBUFFERARB, int, int *) pfwglQueryPbufferARB;
pfwglQueryPbufferARB wglQueryPbufferARB;
//

// WGL_EXT_display_color_table
typedef GLboolean  function(GLushort) pfwglCreateDisplayColorTableEXT;
pfwglCreateDisplayColorTableEXT wglCreateDisplayColorTableEXT;

typedef GLboolean  function(GLushort *, GLuint) pfwglLoadDisplayColorTableEXT;
pfwglLoadDisplayColorTableEXT wglLoadDisplayColorTableEXT;

typedef GLboolean  function(GLushort) pfwglBindDisplayColorTableEXT;
pfwglBindDisplayColorTableEXT wglBindDisplayColorTableEXT;

typedef VOID  function(GLushort) pfwglDestroyDisplayColorTableEXT;
pfwglDestroyDisplayColorTableEXT wglDestroyDisplayColorTableEXT;
//

// WGL_EXT_extensions_string
typedef char *  function() pfwglGetExtensionsStringEXT;
pfwglGetExtensionsStringEXT wglGetExtensionsStringEXT;
//

// WGL_EXT_make_current_read
typedef BOOL  function(HDC, HDC, HGLRC) pfwglMakeContextCurrentEXT;
pfwglMakeContextCurrentEXT wglMakeContextCurrentEXT;

typedef HDC  function() pfwglGetCurrentReadDCEXT;
pfwglGetCurrentReadDCEXT wglGetCurrentReadDCEXT;
//

// WGL_EXT_pbuffer
typedef HPBUFFEREXT  function(HDC, int, int, int, int *) pfwglCreatePbufferEXT;
pfwglCreatePbufferEXT wglCreatePbufferEXT;

typedef HDC  function(HPBUFFEREXT) pfwglGetPbufferDCEXT;
pfwglGetPbufferDCEXT wglGetPbufferDCEXT;

typedef int  function(HPBUFFEREXT, HDC) pfwglReleasePbufferDCEXT;
pfwglReleasePbufferDCEXT wglReleasePbufferDCEXT;

typedef BOOL  function(HPBUFFEREXT) pfwglDestroyPbufferEXT;
pfwglDestroyPbufferEXT wglDestroyPbufferEXT;

typedef BOOL  function(HPBUFFEREXT, int, int *) pfwglQueryPbufferEXT;
pfwglQueryPbufferEXT wglQueryPbufferEXT;
//

// WGL_EXT_pixel_format
typedef BOOL  function(HDC, int, int, UINT, int *, int *) pfwglGetPixelFormatAttribivEXT;
pfwglGetPixelFormatAttribivEXT wglGetPixelFormatAttribivEXT;

typedef BOOL  function(HDC, int, int, UINT, int *, FLOAT *) pfwglGetPixelFormatAttribfvEXT;
pfwglGetPixelFormatAttribfvEXT wglGetPixelFormatAttribfvEXT;

typedef BOOL  function(HDC, int *, FLOAT *, UINT, int *, UINT *) pfwglChoosePixelFormatEXT;
pfwglChoosePixelFormatEXT wglChoosePixelFormatEXT;
//

// WGL_EXT_swap_control
typedef BOOL  function(int) pfwglSwapIntervalEXT;
pfwglSwapIntervalEXT wglSwapIntervalEXT;

typedef int  function() pfwglGetSwapIntervalEXT;
pfwglGetSwapIntervalEXT wglGetSwapIntervalEXT;
//


// WGL_ARB_render_texture
typedef BOOL  function(HPBUFFERARB, int) pfwglBindTexImageARB;
pfwglBindTexImageARB wglBindTexImageARB;

typedef BOOL  function(HPBUFFERARB, int) pfwglReleaseTexImageARB;
pfwglReleaseTexImageARB wglReleaseTexImageARB;

typedef BOOL  function(HPBUFFERARB, int *) pfwglSetPbufferAttribARB;
pfwglSetPbufferAttribARB wglSetPbufferAttribARB;


